<table class="table table-bordered">
    <thead>
        <tr>
            <th>id</th>
            <th>广告标题</th>
            <th>图片</th>      
            <th>广告类型</th>
            <th>连接</th>
            <th >排序字段</th>
            <th>添加时间</th>
            <th>更新时间</th>
            <th>操作</th>
        </tr>
    </thead>
    <tbody>
        <% let {advList,pageIndex,totalPage} = data%>
        <% for(let i=0;i<advList.length;i++){%>
        <tr>
            <td><%= i+1 %></td>
            <td><%=advList[i].advTitle%></td>
            <td><img src="http://localhost:7000/upload/<%=advList[i].advPic%>" alt=""></td>
            <td><%=ADVTYPE[advList[i].advType]%></td>
            <td><%=advList[i].advHref%></td>
            <td><%=advList[i].advOrder%></td>
            <td><%=advList[i].addTime%></td>
            <td><%=advList[i].updateTime%></td>
            <td><button class="btn btn-success btn-sm editBtn" data-id="<%=advList[i]._id%>">编辑</button>
                <button class="btn btn-danger btn-sm delBtn" data-id="<%=advList[i]._id%>">删除</button></td>
        </tr>
        <%}%>
    </tbody>
</table>
<!-- /.card-body -->
<div class="card-footer clearfix">
    <ul class="pagination pagination-sm m-0 float-right">
        <li class="page-item" data-page-index="1"><a class="page-link" href="javascript:;">«</a></li>
        <%for(let i=1; i <= totalPage;i++){%>
        <li data-page-index="<%=i%>" class="page-item <%=i==pageIndex ? 'active' :''%>"><a class="page-link" href="javascript:;"><%=i%></a></li>
        <%}%>
        <li class="page-item" data-page-index="<%=totalPage%>"><a class="page-link" href="javascript:;">»</a></li>
    </ul>
</div>